### Python, for ${Python_EXECUTABLE}
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
### Pybind11
find_package(pybind11 CONFIG REQUIRED)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # main (top) cmake dir

set(CMAKE_VERBOSE_MAKEFILE on)

STRING( REGEX REPLACE ".*/(.*)" "\\1" CURRENT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR} )
PROJECT("${CURRENT_FOLDER}")

SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin/")
SET(BUILD_INPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/input")
SET(BUILD_RELOAD_PATH "${EXECUTABLE_OUTPUT_PATH}/reload")
SET(BUILD_BIND_PATH "${EXECUTABLE_OUTPUT_PATH}/bind")


file(MAKE_DIRECTORY ${BUILD_BIND_PATH})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pybind_tool/
     DESTINATION ${BUILD_BIND_PATH})

aux_source_directory(. DIR_SRCS)
pybind11_add_module(${PROJECT_NAME} ${DIR_SRCS})
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}")
target_link_libraries(${PROJECT_NAME} PRIVATE sphinxsys_3d)
